<?php
/**
 * Модель tag_to_article
 * 
 * Класс модели
 * @author Anton Zavidov
 * @package myLiveShop
 */

/**
 * Модель tag_to_article
 *
 */
class ModelTag_to_article extends Model {
	
	const TABLE				= 'tag_to_article';
	const F_TAG_ID  	= 'tag_id';
	const F_ARTICLE_ID  	= 'article_id';
			
	public function __construct($className=null){
		parent::__construct(__CLASS__);
		$this->name='tag_to_article';
		$this->id_field=array(self::F_TAG_ID,self::F_ARTICLE_ID);
		$this->fields=array(
		self::TABLE.DOT.self::F_TAG_ID=> new Field($this,self::F_TAG_ID,self::TABLE,array(
				'important'=>true,
				'lenght'=>5,
				'join_table'=>'tag')),
		self::TABLE.DOT.self::F_ARTICLE_ID=> new Field($this,self::F_ARTICLE_ID,self::TABLE,array(
				'important'=>true,
				'lenght'=>11,
				'join_table'=>'article'))		);
	}
}
